/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.cloudfarming.client.sensor.explorer;

import nl.cloudfarming.client.sensor.SensorModule;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.util.NbBundle;

/**
 *
 * @author Timon Veenstra
 */
public class SensorRootNode extends AbstractNode {

    public SensorRootNode() {
        super(new Children.Keys() {

            @Override
            protected void addNotify() {
                setKeys(new Object[]{new Object()});
            }


            @Override
            protected Node[] createNodes(Object key) {
                Node filesNode = new AbstractNode(Children.create(new SensorFileNodeFactory(), true));
                filesNode.setDisplayName(NbBundle.getMessage(SensorModule.class, "sensor_explorer.files"));
                Node runsNode = new AbstractNode(Children.create(new SensorRunNodeFactory(), true));
                runsNode.setDisplayName(NbBundle.getMessage(SensorModule.class, "sensor_explorer.runs"));
                return new Node[]{filesNode, runsNode};
            }
        });



    }
}
